package cn.edu.java.thread.四种实现方式;

public class ThreadDemo extends Thread {
    @Override
    public void run() {
        try {
            sleep(1000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }

        System.out.println(getName() + " : 子线程结束！");
    }

    public static void main(String[] args) {
        ThreadDemo threadDemo1 = new ThreadDemo();
        ThreadDemo threadDemo2 = new ThreadDemo();

        threadDemo1.start();
        threadDemo2.start();
        System.out.println(Thread.currentThread().getName() + " : 主线程结束！");
    }
}
